package com.youhome.service.service.impl;


import com.youhome.service.mapper.UnemploymentMapper;
import com.youhome.service.model.Unemployment;
import com.youhome.service.service.UnemploymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * Created by chen365 on 2017/9/15.
 */
@Service
public class UnemploymentServiceImpl implements UnemploymentService {
    @Autowired
    private UnemploymentMapper mapper;

    @Override
    public Double selectRateByUnemployment(Integer type, String abbreviation) {
        Unemployment record = new Unemployment();
        if (type != null)
            record.setType(type);
        if (!StringUtils.isEmpty(abbreviation))
            record.setAbbreviation(abbreviation);
        return mapper.selectRateByUnemployment(record);
    }
}
